package com.lookme.lmtool.cracker.filter.color;

import com.jhlabs.image.ChannelMixFilter;
import com.lookme.lmtool.cracker.CrackerConstants;
import com.lookme.lmtool.cracker.annotation.FilterAnnotation;
import com.lookme.lmtool.cracker.annotation.ParamAnnotation;
import com.lookme.lmtool.cracker.filter.AbstractFilter;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;

import java.awt.image.BufferedImageOp;

@FilterAnnotation(groupName = CrackerConstants.FILTER_GROUP_NAME_COLOR,name="混合RGB通道",filterClass = ChannelMixFilter.class)
public class FilterChannelMix extends AbstractFilter {
    @XStreamAsAttribute
    @ParamAnnotation(name = "蓝绿色", desc = "蓝绿色",inputType = ParamAnnotation.InputType.Spinner,width = 300,max = 256)
    private int blueGreen;
    @XStreamAsAttribute
    @ParamAnnotation(name = "红蓝色", desc = "红蓝色",inputType = ParamAnnotation.InputType.Spinner,width = 300,max = 256)
    private int redBlue;
    @XStreamAsAttribute
    @ParamAnnotation(name = "绿红色", desc = "绿红色",inputType = ParamAnnotation.InputType.Spinner,width = 300,max = 256)
    private int greenRed;
    @XStreamAsAttribute
    @ParamAnnotation(name = "红色", desc = "红色",inputType = ParamAnnotation.InputType.Spinner,width = 300,max = 256)
    private int intoR;
    @XStreamAsAttribute
    @ParamAnnotation(name = "绿色", desc = "绿色",inputType = ParamAnnotation.InputType.Spinner,width = 300,max = 256)
    private int intoG;
    @XStreamAsAttribute
    @ParamAnnotation(name = "蓝色", desc = "蓝色",inputType = ParamAnnotation.InputType.Spinner,width = 300,max = 256)
    private int intoB;


    @Override
    public BufferedImageOp getFilter() {
        ChannelMixFilter filter= new ChannelMixFilter();
        filter.setBlueGreen(blueGreen);
        filter.setGreenRed(greenRed);
        filter.setRedBlue(redBlue);
        filter.setIntoR(intoR);
        filter.setIntoG(intoG);
        filter.setIntoB (intoB);
        return filter;
    }

}
